package com.gy.componit;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.LinkedList;
import java.util.List;
import java.util.Objects;

/**
 * @author Dsy
 * @create 2022-02-03  5:01
 */
@Data
@NoArgsConstructor
public class Area {

    private int x,y;

    private int width,height;

    private List<Component> itemList = new LinkedList<>();

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Area area = (Area) o;
        return x == area.x &&
                y == area.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
}
